home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 23
/
Amiga Format AFCD23 (Feb 1998, Issue 107).iso
/
-seriously_amiga-
/
shareware
/
programming
/
other
/
studio16add
/
sources
/
makesample.asm
< prev
next >
Wrap
Assembly Source File
|
1997-12-01
|
1KB
|
76 lines
* Simple source to initialize a header and save it as a Studio16_2.0 sample
*
* Public domain - made by Kenneth "Kenny" Nilsen
* DEMO purpose ONLY!
incdir inc:
include libraries/studio16file.i
include lvo/exec_lib.i
include lvo/dos_lib.i
incdir
start: lea header(pc),a5
* Initialize Studio16_2.0 sample header:
move.l #S16FID,S16F_ID(a5)
move.l #S16FINIT,S16F_FILTER(a5)
move.l #S16_FREQ_C,S16F_RATE(a5)
move.w #S16_VOL_0,S16F_VOLUME(a5)
move.l #S16_PAN_MID,S16F_PAN(a5)
; move.l #$00120902,S16F_SMPTE(a5) ;=00:18:09:02 (HH:MM:SS:FF) SMPTE
move.l #(End-Sample)/2,S16F_REALSIZE(a5)
move.l #(End-Sample)/2,S16F_EDITSIZE(a5)
move.l #(End-Sample)/2-1,S16F_END(a5)
; save sample
move.l $4.w,a6
lea LibName(pc),a1
moveq #0,d0
jsr _LVOOpenLibrary(a6)
move.l d0,DosBase ;dos library
beq .exit
move.l d0,a6
move.l #Filename,d1
move.l #MODE_NEWFILE,d2
jsr _LVOOpen(a6) ;open new file
move.l d0,d7
beq .cleanup
move.l d0,d1
move.l #Header,d2
move.l #S16F_SIZEOF,d3
jsr _LVOWrite(a6) ;write header
move.l d7,d1
move.l #Sample,d2
move.l #End-Sample,d3
jst _LVOWrite(a6) ;write sample
move.l d7,d1
jsr _LVOClose(a6) ;close file
.cleanup
move.l a6,a1
move.l $4.w,a6 ;close library
jsr _LVOCloseLibrary(a6)
.exit moveq #0,d0 ;exit
rts
Filename dc.b "ram:TestSample_mid",0
LibName dc.b "dos.library",0
even
DosBase dc.l 0
Header dcb.b S16F_SIZEOF,0 ;our header
Sample incbin sample_raw ;our sample
End